<?php include('main.php'); ?>
<div class="content-inner">
    <?php
	echo form_open('login/update', 'class="form-horizontal"');
    //if($this->session->userdata['user_login']){


    if ($edit->num_rows() > 0) {
        foreach ($edit->result() as $row) {

            $firstname = array(
                'name' => 'fname',
                'value' => $row->lastName,
                'id' => 'input01',
                'required' => '',
                'placeholder' => 'Your firstname ',
                'class' => 'input-xlarge'
            );
            $lastname = array(
                'name' => 'lname',
                'value' => $row->lastName,
                'id' => 'input01',
                'required' => '',
                'placeholder' => 'Your surename ',
                'class' => 'input-xlarge'
            );
            $username = array(
                'name' => 'username',
                'value' => $row->user_name,
                'id' => 'input01',
                'required' => '',
                'placeholder' => 'Your username ',
                'class' => 'input-xlarge'
            );
            $getid = array(
                'name' => 'getid',
                'value' => $row->id,
                'id' => 'input01',
                'class' => 'input-xlarge',
                'type' => 'hidden'
            );
            $password = array(
                'name' => 'pass',
                'value' => $row->password,
                'id' => 'input01',
                'required' => '',
                'placeholder' => 'Your password',
                'class' => 'input-xlarge',
                'type' => 'password'
            );
            $confirm_pass = array(
                'name' => 'conf_pass',
                'id' => 'input01',
                'value' => $row->password,
                'required' => '',
                'class' => 'input-xlarge',
                'placeholder' => 'Retype password',
                'required' => '',
                'type' => 'password'
            );
            $email = array(
                'name' => 'email',
                'value' => $row->email,
                'id' => 'input01',
                'placeholder' => 'Your email',
                'required' => '',
                'type' => 'email'
            );
            $gender = array(
                $row->user_gender => $row->user_gender,
                'Male' => 'Male',
                'Female' => 'Female',
                'Other' => 'Other'
            );
            $role = array(
                $row->role_id => $row->role_name,
                '1' => 'Administrator',
                '2' => 'Simple User'
            );
            $nation = array(
                'name' => 'nation',
                'id' => 'input01',
                'class' => 'input-xlarge',
                'required' => '',
                'placeholder' => 'Nationality',
                'required' => '',
                'value' => $row->user_nationality
            );
            $address = array(
                'name' => 'address',
                'id' => 'input01',
                'class' => 'input-xlarge',
                'placeholder' => 'Your address',
                'required' => '',
                'value' => $row->user_add,
                'rows' => '5',
                'cols' => '10',
                'style' => 'width:30%'
            );
        }
        ?>
        <?php
    }
    ?>
    <div class="control-group">
        <label class="control-label" for="input01">First Name </label>
        <div class="controls">
<?php echo form_input($firstname); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">Last Name </label>
        <div class="controls">
<?php echo form_input($lastname); ?>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="input01">UserName </label>
        <div class="controls">
<?php echo form_input($username); ?>
            <?php echo form_input($getid); ?>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="input01">Password </label>
        <div class="controls">
<?php echo form_password($password); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">Confirm Password </label>
        <div class="controls">
<?php echo form_password($confirm_pass); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">Emial Active </label>
        <div class="controls">
<?php echo form_input($email); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">Phone Number </label>
        <div class="controls">
<?php echo form_input($nation); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">Gender </label>
        <div class="controls">
<?php echo form_dropdown('gender', $gender); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">User Role </label>
        <div class="controls">
<?php echo form_dropdown('role', $role); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">Your Address</label>
        <div class="controls">
<?php echo form_textarea($address); ?>
        </div>
    </div>
    <div class="form-actions">
		<?php echo form_submit('btn_update', 'Save', 'class="btn btn-primary"'); ?>
        <?php echo anchor('login/profile', 'Cancel', 'class="btn"'); ?>
    </div>
</form> 


<?php
//}else{echo base_url();}?>